'use strict';

const Controller = require('egg').Controller;

class HomeController extends Controller {
  async index() {
  	const ctx = this.ctx;
  	const banners = await ctx.service.banner.list();
  	const messages = await ctx.service.message.list({pageSize:4, pageNum: 1});
  	const products = await ctx.service.product.hotList();
    ctx.body = {
    	code:'SUCCESS',
    	data:{
	    	banners,
	    	messages,
	    	products,
	    }
    };
  }
}

module.exports = HomeController;
